<extend name="layout/index"/>
<block name="content">
    <div class="wrapper wrapper-content">

        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>模块编辑</h5>
                    </div>
                    <div class="ibox-content">

                        <form role="form" class="form-horizontal m-t" method="post">
                            <input type="hidden" name="id" value="{$info.id}">
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">模块名称：</label>
                                <div class="col-sm-9">
                                    <input type="text" name="title" class="form-control" placeholder="请输入文本" value="{$info.title}">
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">标题：</label>
                                <div class="col-sm-9">
                                    <input type="text" name="headline" class="form-control" placeholder="请输入文本" value="{$info.headline}">
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">副标题：</label>
                                <div class="col-sm-9">
                                    <input type="text" name="subheading" class="form-control" placeholder="请输入文本" value="{$info.subheading}">
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">排序：</label>
                                <div class="col-sm-9">
                                    <input type="number" name="sort" class="form-control" placeholder="请输入文本" value="{$info.sort}">
                                </div>
                            </div>
                            <div class="form-group draggable">
                                <label class="col-sm-3 control-label">状态：
                                </label>

                                <div class="col-sm-9">
                                    <label class="radio-inline">
                                        <input type="radio" name="status" checked=""  value="1">
                                        展示
                                    </label>
                                    <label class="radio-inline">
                                        <input type="radio" name="status" <eq name="info.status" value="0">checked</eq> value="0" >
                                        隐藏
                                    </label>

                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group draggable">
                                <div class="col-sm-12 col-sm-offset-3">
                                    <button class="btn btn-primary" type="button">保存内容</button>
                                    <button class="btn btn-white" type="reset">取消</button>
                                </div>
                            </div>
                        </form>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</block>
<block name="js">
    <script>
        $(".btn-primary").click(function(){
            //   alert($("form").serialize());
            $.ajax({
                type : "post",
                url : "{:url('server/cate_edit')}",
                data : $("form").serialize(),
                dataType : "json",
                success : function(data) {
                    layer.msg(data.msg);
                    if (data.code==1) {
                        location.href=data.url;;
                    }
                },
                error : function(err) {
                    layer.alert(err.info, 8);
                }
            });
        })
    </script>
</block>

